<template>
  <div class="news-list">
    <van-card
      v-for="item in newsList"
      :key="item.id"
      :title="item.content"
      :thumb="item.img_url"
      :thumb-link="'#/home/newsinfo/'+item.id"
    >
     <template #num>
       点击了{{item.click}}次
    </template>
    <template #price>
      {{item.add_time}}
    </template>
    </van-card>
  </div>
</template>
<script>
export default {
  data () {
    return {
      newsList:[]
    }
  },
  created () {
    this.getNewsList()
  },
  methods:{
    async getNewsList () {
      const res = await this.$http.getNewsList()
      this.newsList = res.data.message
      console.log(this.newsList)
    }
  }

}
</script>
<style lang="scss" scoped>
.news-list{
  .van-card__thumb{
    height: 55px;
  }
  .van-card__content{
   min-height: 55px;
  }
  .van-card__title{
    display: -webkit-box;
    -webkit-line-clamp: 1;
  }
  .van-card__price{
    color: red;
  }
}
</style>
